let hold = new Batch.Hold();
let signalId = this._userList.connect('item-added',
() => {
- let item = this._userList.getItemFromUserName(userName);
+ item = this._userList.getItemFromUserName(userName);
if (item)
hold.release();
} catch (e) {
}
// If an engine is already active we need to get its properties
- this._ibus.get_global_engine_async(-1, this._cancellable, (_bus, result) => {
+ this._ibus.get_global_engine_async(-1, this._cancellable, (_bus, res) => {
let engine;
try {
- engine = this._ibus.get_global_engine_async_finish(result);
+ engine = this._ibus.get_global_engine_async_finish(res);
if (!engine)
return;
} catch (e) {
let sessionId = GLib.getenv('XDG_SESSION_ID');
if (!sessionId) {
log('Unset XDG_SESSION_ID, getCurrentSessionProxy() called outside a user session. Asking logind directly.');
- let [session, objectPath_] = this._userProxy.Display;
+ let [session, objectPath] = this._userProxy.Display;
if (session) {
log(`Will monitor session ${session}`);
sessionId = session;
} else {
log('Failed to find "Display" session; are we the greeter?');
- for (let [session, objectPath] of this._userProxy.Sessions) {
+ for ([session, objectPath] of this._userProxy.Sessions) {
let sessionProxy = new SystemdLoginSession(Gio.DBus.system,
'org.freedesktop.login1',
objectPath);
if (!parent)
throw new Error("actor not in scroll view");
- let box = parent.get_allocation_box();
+ box = parent.get_allocation_box();
y1 += box.y1;
y2 += box.y1;
parent = parent.get_parent();
return;
}
- this._permStore.LookupRemote('gnome', 'geolocation', (res, error) => {
- if (error)
- log(`Error looking up permission: ${error.message}`);
+ this._permStore.LookupRemote('gnome', 'geolocation', (res, err) => {
+ if (err)
+ log(`Error looking up permission: ${err.message}`);
- let [perms, data] = error ? [{}, null] : res;
+ let [perms, data] = err ? [{}, null] : res;
let params = ['gnome', 'geolocation', false, data, perms];
this._onPermStoreChanged(this._permStore, '', params);
});
addFolderPopup(popup) {
this._stack.add_actor(popup);
- popup.connect('open-state-changed', (popup, isOpen) => {
+ popup.connect('open-state-changed', (o, isOpen) => {
this._eventBlocker.reactive = isOpen;
if (this._currentPopup) {
let monitor = file.monitor(Gio.FileMonitorFlags.NONE, null);
monitor.connect('changed',
- (obj, file, otherFile, eventType) => {
+ (obj, theFile, otherFile, eventType) => {
// Ignore CHANGED and CREATED events, since in both cases
// we'll get a CHANGES_DONE_HINT event when done.
if (eventType != Gio.FileMonitorEvent.CHANGED &&
}
let clickAction = new Clutter.ClickAction();
- clickAction.connect('long-press', (action, actor, state) => {
+ clickAction.connect('long-press', (action, theActor, state) => {
if (state == Clutter.LongPressState.QUERY)
return ((action.get_button() == 0 ||
action.get_button() == 1) &&
notificationAddedId: 0,
};
- obj.destroyId = source.connect('destroy', source => {
+ obj.destroyId = source.connect('destroy', () => {
this._onSourceDestroy(source, obj);
});
obj.notificationAddedId = source.connect('notification-added',
Util.ensureActorVisibleInScrollView(this._scrollView, messageActor);
}));
- connectionsIds.push(section.connect('destroy', (section) => {
+ connectionsIds.push(section.connect('destroy', () => {
connectionsIds.forEach(id => section.disconnect(id));
this._sectionList.remove_actor(section);
}));
// mount operation object
if (drive.can_stop()) {
drive.stop(Gio.MountUnmountFlags.FORCE, null, null,
- (drive, res) => {
+ (o, res) => {
try {
drive.stop_finish(res);
} catch (e) {
});
} else if (drive.can_eject()) {
drive.eject_with_operation(Gio.MountUnmountFlags.FORCE, null, null,
- (drive, res) => {
+ (o, res) => {
try {
drive.eject_with_operation_finish(res);
} catch (e) {
let hotplugSniffer = new HotplugSniffer();
hotplugSniffer.SniffURIRemote(root.get_uri(),
- ([contentTypes]) => {
+ result => {
+ [contentTypes] = result;
this._emitCallback(mount, contentTypes);
});
}
if (!this._session.SessionIsActive)
return;
- let discoverer = new ContentTypeDiscoverer((mount, apps, contentTypes) => {
+ let discoverer = new ContentTypeDiscoverer((m, apps, contentTypes) => {
this._dispatcher.addMount(mount, apps, contentTypes);
});
discoverer.guessContentTypes(mount);
}
// Approve private text channels right away as we are going to handle it
- dispatchOp.claim_with_async(this, (dispatchOp, result) => {
+ dispatchOp.claim_with_async(this, (o, result) => {
try {
dispatchOp.claim_with_finish(result);
this._handlingChannels(account, conn, [channel], false);
let appIcon = new DashIcon(app);
appIcon.connect('menu-state-changed',
- (appIcon, opened) => {
+ (o, opened) => {
this._itemMenuStateChanged(item, opened);
});
this._grabbedDevice = pointer;
this._touchSequence = touchSequence;
- this._capturedEventId = global.stage.connect('captured-event', (actor, event) => {
+ this._capturedEventId = global.stage.connect('captured-event', (o, event) => {
let device = event.get_device();
if (device != this._grabbedDevice &&
device.get_device_type() != Clutter.InputDeviceType.KEYBOARD_DEVICE)
let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
- _httpSession.queue_message(message, (session, message) => {
+ _httpSession.queue_message(message, () => {
if (message.status_code != Soup.KnownStatusCode.OK) {
Main.extensionManager.logExtensionError(uuid, `downloading info: ${message.status_code}`);
invocation.return_dbus_error('org.gnome.Shell.DownloadInfoError', message.status_code.toString());
return;
}
- GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, (pid, status) => {
+ GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, (o, status) => {
GLib.spawn_close_pid(pid);
if (status != 0)
let url = REPOSITORY_URL_DOWNLOAD.format(uuid);
let message = Soup.form_request_new_from_hash('GET', url, params);
- _httpSession.queue_message(message, (session, message) => {
+ _httpSession.queue_message(message, session => {
gotExtensionZipFile(session, message, uuid, newExtensionTmpDir, () => {
let oldExtension = Main.extensionManager.lookup(uuid);
let extensionDir = oldExtension.dir;
}
FileUtils.recursivelyDeleteDir(oldExtensionTmpDir, true);
- }, (code, message) => {
- log('Error while updating extension %s: %s (%s)'.format(uuid, code, message ? message : ''));
+ }, (code, msg) => {
+ log(`Error while updating extension ${uuid}: ${code} (${msg})`);
});
});
}
let url = REPOSITORY_URL_UPDATE;
let message = Soup.form_request_new_from_hash('GET', url, params);
- _httpSession.queue_message(message, (session, message) => {
+ _httpSession.queue_message(message, () => {
if (message.status_code != Soup.KnownStatusCode.OK)
return;
let uuid = this._uuid;
let dir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
let invocation = this._invocation;
- function errback(code, message) {
- let msg = message ? message.toString() : '';
- log('Error while installing %s: %s (%s)'.format(uuid, code, msg));
- invocation.return_dbus_error(`org.gnome.Shell.${code}`, msg);
+ function errback(code, msg) {
+ log(`Error while installing ${uuid}: ${code} (${msg})`);
+ invocation.return_dbus_error(`org.gnome.Shell.${code}`, msg || '');
}
function callback() {
invocation.return_value(GLib.Variant.new('(s)', ['successful']));
}
- _httpSession.queue_message(message, (session, message) => {
+ _httpSession.queue_message(message, session => {
gotExtensionZipFile(session, message, uuid, dir, callback, errback);
});
let orderReversed = order.slice().reverse();
for (let i = 0; i < orderReversed.length; i++) {
- let uuid = orderReversed[i];
+ let otherUuid = orderReversed[i];
try {
- this.lookup(uuid).stateObj.disable();
+ this.lookup(otherUuid).stateObj.disable();
} catch (e) {
- this.logExtensionError(uuid, e);
+ this.logExtensionError(otherUuid, e);
}
}
}
for (let i = 0; i < order.length; i++) {
- let uuid = order[i];
+ let otherUuid = order[i];
try {
- this.lookup(uuid).stateObj.enable();
+ this.lookup(otherUuid).stateObj.enable();
} catch (e) {
- this.logExtensionError(uuid, e);
+ this.logExtensionError(otherUuid, e);
}
}
this._permStore.LookupRemote(APP_PERMISSIONS_TABLE,
APP_PERMISSIONS_ID,
- (res, error) => {
- if (error) {
+ (res, err) => {
+ if (err) {
this._dialog.open();
- log(error.message);
+ log(err.message);
return;
}
}
_updateBackgrounds() {
- let i;
- for (i = 0; i < this._bgManagers.length; i++)
+ for (let i = 0; i < this._bgManagers.length; i++)
this._bgManagers[i].destroy();
this._bgManagers = [];
} catch (e) {
link = new St.Label({ text: '<error>' });
}
- let hbox = new St.BoxLayout();
- hbox.add(new St.Label({ text: `${propName}: ` }));
- hbox.add(link);
- this._container.add_actor(hbox);
+ let box = new St.BoxLayout();
+ box.add(new St.Label({ text: `${propName}: ` }));
+ box.add(link);
+ this._container.add_actor(box);
}
}
}
let dataDirs = GLib.get_system_data_dirs();
for (let i = 0; i < dataDirs.length; i++) {
let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);
- let stylesheet = Gio.file_new_for_path(path);
+ stylesheet = Gio.file_new_for_path(path);
if (stylesheet.query_exists(null))
return stylesheet;
}
return;
}
- let [pid] = result;
+ [pid] = result;
source = this._getSource(appName, pid, ndata, sender, null);
this._senderToPid[sender] = pid;
constructor() {
let manager = Clutter.DeviceManager.get_default();
- manager.connect('ptr-a11y-timeout-started', (manager, device, type, timeout) => {
+ manager.connect('ptr-a11y-timeout-started', (o, device, type, timeout) => {
let [x, y] = global.get_pointer();
this._pieTimer = new PieTimer();
global.display.set_cursor(Meta.Cursor.CROSSHAIR);
});
- manager.connect('ptr-a11y-timeout-stopped', (manager, device, type, clicked) => {
+ manager.connect('ptr-a11y-timeout-stopped', (o, device, type, clicked) => {
if (!clicked)
this._pieTimer.destroy();
menuItem = new PopupMenuItem(title);
this.addMenuItem(menuItem);
- menuItem.connect('activate', (menuItem, event) => {
+ menuItem.connect('activate', (o, event) => {
callback(event);
});
}
_connectItemSignals(menuItem) {
- menuItem._activeChangeId = menuItem.connect('notify::active', menuItem => {
+ menuItem._activeChangeId = menuItem.connect('notify::active', () => {
let active = menuItem.active;
if (active && this._activeMenuItem != menuItem) {
if (this._activeMenuItem)
menuItem.actor.grab_key_focus();
}
});
- menuItem._activateId = menuItem.connect_after('activate', (menuItem, _event) => {
+ menuItem._activateId = menuItem.connect_after('activate', () => {
this.emit('activate', menuItem);
this.itemActivated(BoxPointer.PopupAnimation.FULL);
});
// the menuItem may have, called destroyId
// (FIXME: in the future it may make sense to have container objects
// like PopupMenuManager does)
- menuItem._popupMenuDestroyId = menuItem.connect('destroy', menuItem => {
+ menuItem._popupMenuDestroyId = menuItem.connect('destroy', () => {
menuItem.disconnect(menuItem._popupMenuDestroyId);
menuItem.disconnect(menuItem._activateId);
menuItem.disconnect(menuItem._activeChangeId);
try {
Gio.app_info_launch_default_for_uri(file.get_uri(),
global.create_app_launch_context(0, -1));
- } catch (e) {
+ } catch (err) {
// The exception from gjs contains an error string like:
// Error invoking Gio.app_info_launch_default_for_uri: No application
// is registered as handling this file
// We are only interested in the part after the first colon.
- let message = e.message.replace(/[^:]*: *(.+)/, '$1');
+ let message = err.message.replace(/[^:]*: *(.+)/, '$1');
this._showError(message);
}
} else {
this._showSource(source, obj, obj.sourceBox);
this._notificationBox.add_child(obj.sourceBox);
- obj.sourceCountChangedId = source.connect('notify::count', source => {
+ obj.sourceCountChangedId = source.connect('notify::count', () => {
this._countChanged(source, obj);
});
- obj.sourceTitleChangedId = source.connect('notify::title', source => {
+ obj.sourceTitleChangedId = source.connect('notify::title', () => {
this._titleChanged(source, obj);
});
obj.policyChangedId = source.policy.connect('notify', (policy, pspec) => {
else
this._detailedChanged(source, obj);
});
- obj.sourceDestroyId = source.connect('destroy', source => {
+ obj.sourceDestroyId = source.connect('destroy', () => {
this._onSourceDestroy(source, obj);
});
SelectAreaAsync(params, invocation) {
let selectArea = new SelectArea();
selectArea.show();
- selectArea.connect('finished', (selectArea, areaRectangle) => {
+ selectArea.connect('finished', (o, areaRectangle) => {
if (areaRectangle) {
let retRectangle = this._unscaleArea(areaRectangle.x, areaRectangle.y,
areaRectangle.width, areaRectangle.height);
PickColorAsync(params, invocation) {
let pickPixel = new PickPixel();
pickPixel.show();
- pickPixel.connect('finished', (pickPixel, coords) => {
+ pickPixel.connect('finished', (obj, coords) => {
if (coords) {
let screenshot = this._createScreenshot(invocation, false);
if (!screenshot)
});
settings.connect(`changed::${KEY_TEXT_SCALING_FACTOR}`, () => {
- let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
+ factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
let active = (factor > 1.0);
widget.setToggleState(active);
return;
let group = item.radioGroup;
- for (let i = 0; i < group.length; ++i) {
- if (group[i] == item) {
+ for (let j = 0; j < group.length; ++j) {
+ if (group[j] == item) {
item.setOrnament(PopupMenu.Ornament.DOT);
item.prop.set_state(IBus.PropState.CHECKED);
ibusManager.activateProperty(item.prop.get_key(),
IBus.PropState.CHECKED);
} else {
- group[i].setOrnament(PopupMenu.Ornament.NONE);
- group[i].prop.set_state(IBus.PropState.UNCHECKED);
- ibusManager.activateProperty(group[i].prop.get_key(),
+ group[j].setOrnament(PopupMenu.Ornament.NONE);
+ group[j].prop.set_state(IBus.PropState.UNCHECKED);
+ ibusManager.activateProperty(group[j].prop.get_key(),
IBus.PropState.UNCHECKED);
}
}
return;
item.connect('icon-changed', () => this._iconChanged());
- item.connect('activation-failed', (item, reason) => {
+ item.connect('activation-failed', (o, reason) => {
this.emit('activation-failed', reason);
});
item.connect('name-changed', this._sync.bind(this));
} else if (result == PortalHelperResult.COMPLETED) {
this._closeConnectivityCheck(path);
} else if (result == PortalHelperResult.RECHECK) {
- this._client.check_connectivity_async(null, (client, result) => {
+ this._client.check_connectivity_async(null, (client, res) => {
try {
- let state = client.check_connectivity_finish(result);
+ let state = client.check_connectivity_finish(res);
if (state >= NM.ConnectivityState.FULL)
this._closeConnectivityCheck(path);
} catch (e) { }
this._indicator = null;
this._menuSection = null;
- controller.connect('new-handle', (controller, handle) => {
+ controller.connect('new-handle', (o, handle) => {
this._onNewHandle(handle);
});
}
maxChildNat = Math.max(childNat, maxChildNat);
if (this._squareItems) {
- let [childMin, childNat] = this._items[i].get_preferred_height(-1);
+ [childMin, childNat] = this._items[i].get_preferred_height(-1);
maxChildMin = Math.max(childMin, maxChildMin);
maxChildNat = Math.max(childNat, maxChildNat);
}
source.showNotification(notification);
source.signalIDs.push(window.connect('notify::title', () => {
- let [title, banner] = this._getTitleAndBanner(app, window);
+ [title, banner] = this._getTitleAndBanner(app, window);
notification.update(title, banner);
}));
}
var DIM_BRIGHTNESS = -0.3;
var DIM_TIME = 500;
var UNDIM_TIME = 250;
-var MOTION_THRESHOLD = 100;
+var WS_MOTION_THRESHOLD = 100;
+var APP_MOTION_THRESHOLD = 30;
var ONE_SECOND = 1000; // in ms
_checkActivated() {
let dir;
- if (this._dy < -MOTION_THRESHOLD)
+ if (this._dy < -WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.DOWN;
- else if (this._dy > MOTION_THRESHOLD)
+ else if (this._dy > WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.UP;
- else if (this._dx < -MOTION_THRESHOLD)
+ else if (this._dx < -WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.RIGHT;
- else if (this._dx > MOTION_THRESHOLD)
+ else if (this._dx > WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.LEFT;
else
return false;
vfunc_swipe(actor, direction) {
let [x, y] = this.get_motion_coords(0);
let [xPress, yPress] = this.get_press_coords(0);
- if (Math.abs(x - xPress) < MOTION_THRESHOLD &&
- Math.abs(y - yPress) < MOTION_THRESHOLD) {
+ if (Math.abs(x - xPress) < WS_MOTION_THRESHOLD &&
+ Math.abs(y - yPress) < WS_MOTION_THRESHOLD) {
this.emit('cancel');
return;
}
}
vfunc_gesture_progress(_actor) {
- const MOTION_THRESHOLD = 30;
if (this.get_n_current_points() == 3) {
for (let i = 0; i < this.get_n_current_points(); i++) {
let [startX, startY] = this.get_press_coords(i);
let [x, y] = this.get_motion_coords(i);
- if (Math.abs(x - startX) > MOTION_THRESHOLD ||
- Math.abs(y - startY) > MOTION_THRESHOLD)
+ if (Math.abs(x - startX) > APP_MOTION_THRESHOLD ||
+ Math.abs(y - startY) > APP_MOTION_THRESHOLD)
return false;
}
_addWindowClone(win) {
let clone = new WindowClone(win);
- clone.connect('selected', (clone, time) => {
+ clone.connect('selected', (o, time) => {
this.activate(time);
});
clone.connect('drag-begin', () => {